<div class="row">
     <div class="col-xs-12 col-xs-12">
          <div class="widget radius-bordered">
              <div class="widget-header bg-blue">
				<i class="widget-icon fa fa-arrow-down"></i>
				<span class="widget-caption">分销商设置</span>
				<div class="widget-buttons">
					<a href="#" data-toggle="maximize">
						<i class="fa fa-expand"></i>
					</a>
					<a href="#" data-toggle="collapse">
						<i class="fa fa-minus"></i>
					</a>
					<a href="#" data-toggle="dispose">
						<i class="fa fa-times"></i>
					</a>
				</div>
			</div>
              <div class="widget-body">
                   <form id="JoelForm" action="" method="post" class="form-horizontal"
                                                  data-bv-message=""
                                                  data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
                                                  data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
                                                  data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
                  <input type="hidden" name="id" value="{$cache.id}">
                  <div class="form-title">
                        <a href="{:U('Cms/Fxs/user/')}" class="btn btn-primary" data-loader="Joel-loader" data-loadername="分销商管理">
						<i class="fa fa-mail-reply"></i>返回
						</a>
                   </div>
                   <empty name="cache.id">
                   <div class="form-group">
                        <label class="col-lg-2 control-label">选择父级分销商</label>
                        <div class="col-lg-4">
                             <select class="form-control" name="pid" >
                                  <option value="0">顶级分销商</option>
                                  <volist name="cate" id="vo">
                                  	<option value="{$vo.id}" <eq name="vo.id" value="$cache.pid">selected</eq>>{$vo.nickname}</option>
                                  		<volist name="vo['_child']" id="vo2">
											<option value="{$vo2.id}" <eq name="vo2.id" value="$cache.pid">selected</eq>>&nbsp;&nbsp;└{$vo2.nickname}</option>
												<foreach name="vo2['_child']" item="vo3">
													<option value="{$vo3.id}" <eq name="vo3.id" value="$cache.pid">selected</eq>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└{$vo3.nickname}</option>
													<foreach name="vo3['_child']" item="vo4">
														<option value="{$vo4.id}" <eq name="vo4.id" value="$cache.pid">selected</eq>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└{$vo4.nickname}</option>
														<foreach name="vo4['_child']" item="vo5">
															<option value="{$vo5.id}" <eq name="vo5.id" value="$cache.pid">selected</eq>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└{$vo5.nickname}</option>														
														</foreach>
													</foreach>
												</foreach>
										</volist>
                                  </volist>
                             </select>

                        </div>
                   </div>
                   <else/>
                   <input type="hidden" name="pid" value="{$cache.pid}">
                   </empty>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">分销商名称<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" name="nickname" placeholder="必填"
                                                               data-bv-notempty="true"
                                                               data-bv-notempty-message="不能为空" value="{$cache.nickname}">
                        </div>
                   </div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">分销商编号<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" name="no" placeholder="必填"
                                                               data-bv-notempty="true"
                                                               data-bv-notempty-message="不能为空" value="{$cache.no}">
                        </div>
                   </div>
                   <empty name="cache.id">                  
                   <div class="form-group">
                        <label class="col-lg-2 control-label">登陆用户名<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" name="username" placeholder="必填"
                                                               data-bv-notempty="true"
                                                               data-bv-notempty-message="不能为空" value="{$cache.username}">
                        </div>
                   </div>                  
                   <div class="form-group">
                        <label class="col-lg-2 control-label">登陆密码<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" name="userpass" placeholder="必填"
                                                               data-bv-notempty="true"
                                                               data-bv-notempty-message="不能为空" value="{$cache.userpass}">
                        </div>
                   </div>
                   <else/>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">登陆密码<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" name="userpass" placeholder="不修改请留空" value="">
                        </div>
                   </div>
                   </empty>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">可开设下级总数<sup>*</sup></label>
                        <div class="col-lg-4">
                        	<input type="text" class="form-control" name="sonnum" placeholder="必填"
                                                               data-bv-notempty="true"
                                                               data-bv-notempty-message="不能为空" value="{$cache.sonnum}">
                        </div>
                   </div>
                   <notempty name="cache.id">
                   <div class="form-group">
                        <label class="col-lg-2 control-label">分销商编号</label>
                        <div class="col-lg-4">
                        	<input type="text" class="form-control" placeholder="不允许修改" value="{$cache.no}">                        
                        </div>
                   </div>
                   </notempty>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">分销商电话</label>
                        <div class="col-lg-4">
                        	<input type="text" class="form-control" name="mobile" placeholder="选填" value="{$cache.mobile}">                        
                        </div>
                   </div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">分销商备注</label>
                        <div class="col-lg-4">
                        <textarea class="form-control" name="summary" rows="5">{$cache.summary}</textarea>
                        </div>
                   </div>                   
                   <!--提现信息-->
                  <div class="form-title"></div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">提现姓名</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" name="txname"  value="{$cache.txname}">
                        </div>
                   </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">提现电话</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" name="txmobile"  value="{$cache.txmobile}">
                        </div>
                   </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">提现银行</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" name="txyh" value="{$cache.txyh}">
                        </div>
                   </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">提现分行</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" name="txfh" value="{$cache.txfh}">
                        </div>
                   </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">提现所在地</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" name="txszd" value="{$cache.txszd}">
                        </div>
                   </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">提现卡号</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" name="txcard" value="{$cache.txcard}">
                        </div>
                   </div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">启用/禁用</label>
                        <div class="col-lg-4">
                        	<label>
                        		  <input type="hidden" name="status" value="{$cache.status}" id="isstatus">
                                  <input class="checkbox-slider slider-icon colored-darkorange" type="checkbox" id="isstatusbtn" <eq name="cache.status" value="1">checked="checked"</eq>>
                                  <span class="text darkorange">&nbsp;&nbsp;&larr;重要：禁用此用户后，此用户将不可以登陆与累积增加佣金！</span>
                            </label>
                        </div>
                   </div>
					<div class="form-group">
                             <div class="col-lg-offset-2 col-lg-4">
                             	<button class="btn btn-primary btn-lg" type="submit">保存</button>&nbsp;&nbsp;&nbsp;&nbsp;
                             	<button class="btn btn-palegreen btn-lg" type="reset">重填</button>
                       		 </div>
                    </div>
                   </form>
                </div>
        </div>
	</div>
     
</div>
<!--面包屑导航封装-->
<div id="tmpbread" style="display: none;">{$breadhtml}</div>
<script type="text/javascript">
	setBread($('#tmpbread').html());
</script>
<!--/面包屑导航封装-->
<!--表单验证与提交封装-->
<script type="text/javascript">
	$('#JoelForm').bootstrapValidator({
		submitHandler: function (validator, form, submitButton) {
           var tourl="{:U('Cms/Fxs/userSet')}";
			var data=$('#JoelForm').serialize();
			$.Joel.ajax('post',tourl,data,null);
			return false;
        },
	});
</script>
<!--/表单验证与提交封装-->
<script type="text/javascript">
	$('#isstatusbtn').on('click',function(){
		var value=$(this).prop('checked')?1:0;
		$('#isstatus').val(value);
	});
</script>